package applet.misc.action;

import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class EnableActionListener implements ActionListener
{
	private Component component;
	public Component component() { return component; }
	public void setComponent(Component component) { this.component = component; }
	
	private boolean enable;
	public boolean enable() { return enable; }
	public void setEnable(boolean enable) { this.enable = enable; }
	
	public EnableActionListener(Component component, boolean enable)
	{
		setComponent(component);
		setEnable(enable);
	}

	@Override public void actionPerformed(ActionEvent e) { component.setEnabled(enable); }
}